package com.example.coursedesign.ui.dashboard.entity;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class Science {
    private Integer id;
    private String title;
    private String category;
    private String publish_time;
    private Integer read_count;
    private String content;
    private String image;

    public Science(){}

    public Science(Integer id, String title, String category, String publish_time, Integer read_count, String content, String image) {
        this.id = id;
        this.title = title;
        this.category = category;
        this.publish_time = publish_time;
        this.read_count = read_count;
        this.content = content;
        this.image = image;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getPublish_time() {
        return publish_time;
    }

    public void setPublish_time(String publish_time) {
        this.publish_time = publish_time;
    }

    public Integer getRead_count() {
        return read_count;
    }

    public void setRead_count(Integer read_count) {
        this.read_count = read_count;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }
    public void incrementReadCount() {
        if (this.read_count != null) {
            this.read_count++;
        } else {
            this.read_count = 1; // 如果 read_count 是 null，则初始化为1
        }
    }


}
